# -*- coding: utf-8 -*-
# @Time : 2023/12/17 22:01
# @Author : Lpb
# @File : demo1.py
class MathFormula:
    i='3.1415926'  #类的属性
    name='lpob'
    def formula1(self,a,b,c): #方法
        print(f'formula1的结果{self.i}')
        return  a+b-c

    def formula2(self,a,b):
        print(f'formula2的结果{self.formula1(2,3,4)}')
        return a * b - b * a

print(f'class1 类的结果{MathFormula().formula2(2,6)}')
print(f'class2 类的结果{MathFormula().formula1(2,7,9)}')
print(f'class3 类的结果{MathFormula().name}')

#实例化
mf = MathFormula()
print(mf.formula1(2,9,2))
print(mf.formula2(3,4))

# name='homin'
# print(name.replace('h','p'))
#
# def lol():
#     print('plays games')
#
# formula1(3,4,6)
# formula2(4,5)